import request from '/@/utils/request'
// 查询授权服务器列表
export function listSsoAuthServer(query:object) {
  return request({
    url: '/api/v1/sso/client/ssoAuthServer/list',
    method: 'get',
    params: query
  })
}
// 查询授权服务器详细
export function getSsoAuthServer(id:number) {
  return request({
    url: '/api/v1/sso/client/ssoAuthServer/get',
    method: 'get',
    params: {
      id: id.toString()
    }
  })
}
// 新增授权服务器
export function addSsoAuthServer(data:object) {
  return request({
    url: '/api/v1/sso/client/ssoAuthServer/add',
    method: 'post',
    data: data
  })
}
// 修改授权服务器
export function updateSsoAuthServer(data:object) {
  return request({
    url: '/api/v1/sso/client/ssoAuthServer/edit',
    method: 'put',
    data: data
  })
}
// 删除授权服务器
export function delSsoAuthServer(ids:number[]) {
  return request({
    url: '/api/v1/sso/client/ssoAuthServer/delete',
    method: 'delete',
    data:{
      ids:ids
    }
  })
}


// 获取授权服务器应用
export function getSsoAuthServerLink() {
  return request({
    url: '/api/v1/sso/client/login/authLink',
    method: 'get',
  })
}

// 获取授权服务器应用
export function getSsoUserInfo(token:string) {
  return request({
    url: '/api/v1/sso/client/login/userinfo',
    method: 'post',
    data:{token}
  })
}


// 获取授权服务器应用
export function getSsoEmail(token:string) {
  return request({
    url: '/api/v1/sso/client/login/email',
    method: 'post',
    data:{token}
  })
}

export function getSsoMobile(token:string) {
  return request({
    url: '/api/v1/sso/client/login/mobile',
    method: 'post',
    data:{token}
  })
}
